<template>
	<div class="pagesListcont">
		<div class="listItems" v-for="(ite,idx) in list" :key="idx">
			<div class="listItems_title">
				<div class="listItems_title_left">
					邀约通知
				</div>
				<!-- 	<div class="listItems_title_right" :class="'roomColor'+ite.status">
					{{ite.status | statusFilterSB}}
				</div> -->
			</div>
			<div class="listItems_cont">
				<p>创建人：{{ite.name}}</p>
				<!-- <p>创建时间：{{ite.addtime}}</p> -->
				<p>入住房间：{{ite.floor_name}}{{ite.storey_name}}{{ite.room_name}}</p>
			</div>
			<div class="listItems_bz">
				<!-- 备注：xxx问题有点大 尽快！ -->
			</div>
			<!-- btn -->
			<div class="listItems_btn">
				<!-- <div class="listItems_btn_qx btn">
					取消
				</div> -->
				<div class="listItems_btn_zj btn" @click.stop='quedingEvent(ite,ite.anchor_id)' v-if="pageType == 2">
					确定入住
				</div>
				<div class="listItems_btn_zj btn" @click.stop='qianwangEvetn()' v-else>
					前往处理
				</div>
			</div>

		</div>

	</div>
</template>

<script>
	export default {
		// 1正常 2维修中 3报废 4故障
		filters: {
			statusFilterSB(v) {
				var s = ''
				// 1可预定 2待入驻 3已入住 4待搬离 5未保洁
				switch (v) {
					case '1':
						s = '正常'
						break;
					case '2':
						s = '维修中'
						break;
					case '3':
						s = '报废'
						break;
					case '4':
						s = '故障'
						break;
				}
				return s
			}
		},

		data() {
			return {
				froolShow: false,
				from: {},
				equipment_id: '',
				userStatus: uni.getStorageSync('userStatus'),
				list: [],
				pageType: 1,
			}
		},
		onLoad(opt) {
			this.pageType = opt.type || 1
			if (opt.type == 2) {
				this.getMSGXZ()
			} else {
				this.getMSG()
			}
		},
		methods: {
			async getMSG() {
				const {
					data
				} = await this.$request(this.$Api.noticeList2, {

				}, "POST")
				this.list = data.data
			},
			async getMSGXZ() {
				const {
					data
				} = await this.$request(this.$Api.anchorList1, {

				}, "POST")
				this.list = data.data
			},
			// anchorList
			qianwangEvetn() {
				uni.navigateTo({
					url: '/pages/invite/invite?status=' + this.userStatus
				})
			},
			async quedingEvent(e, id) {
				uni.navigateTo({
					url: '/pages/info/yaoyueSOP?ite=' + JSON.stringify(e)
				})
				return
				console.log('anchor_id', e, id)
				const {
					data
				} = await this.$request(this.$Api.anchorSuer, {
					'anchor_id': id,
				}, "POST")
				if (data.code !== 0) return
				uni.showToast({
					title: '操作成功',
					icon: 'none'
				})
				setTimeout((res) => {
					uni.navigateBack()
				}, 800)

			}
		}
	}
</script>

<style lang="less">
	.pagesListcont {
		.listItems {
			width: 100%;
			min-height: 422rpx;
			background: #FFFFFF;
			border-radius: 12rpx;
			margin: 20rpx auto 0 auto;
			padding: 0 40rpx;
			box-sizing: border-box;
			font-size: 32rpx;
			color: #000;

			.listItems_btn {
				display: flex;
				align-items: center;
				justify-content: flex-end;
				width: 100%;
				height: 120rpx;

				.btn {
					width: 164rpx;
					height: 68rpx;
					background: #FFFFFF;
					border: 2rpx solid #999999;
					margin-left: 26rpx;
					text-align: center;
					line-height: 68rpx;

				}

				.listItems_btn_zj {
					color: #3B7AFF;
					border: 2rpx solid #2D60FF;
				}

				.listItems_btn_cl {
					color: #fff;
					border: 2rpx solid #2D60FF;
					background: #2D60FF;
				}

			}

			.listItems_title {
				display: flex;
				align-items: center;
				justify-content: space-between;
				height: 108rpx;
				width: 100%;
			}

			.listItems_title_right {
				color: #FF1D1D;
			}

			.listItems_cont {
				p {
					color: #666;
					font-size: 28rpx;
					margin-bottom: 14rpx;
				}
			}

			.listItems_bz {
				min-height: 10rpx;
				padding: 10rpx 0 30rpx 0;
				border-bottom: 1px solid #DDDDDD;
				color: #666;
				font-size: 28rpx;

			}
		}
	}
</style>